package com.amumu.drama.common.modules.invitation.service;

import com.amumu.drama.common.base.api.CommonPage;
import com.amumu.drama.common.base.api.CommonResult;
import com.amumu.drama.common.modules.invitation.dto.req.InvitationAnchorPageQuery;
import com.amumu.drama.common.modules.invitation.dto.resp.InvitationAnchorDetailResp;
import com.amumu.drama.common.modules.invitation.dto.AnchorDto;
import com.amumu.drama.common.modules.invitation.dto.resp.InvitationAnchorListResp;
import com.amumu.drama.model.InvitationAnchor;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;


/**
 * @date 2024/04/02
 * @author pgt
 */
public interface InvitationAnchorService extends IService<InvitationAnchor> {

    InvitationAnchor getEffectiveInvitationAnchor(String invitationCode);

    /**
     * 生成线下主播优惠码
     * @param anchorDto
     * @return
     */
    CommonResult<String> generateInvitationAnchorCode(AnchorDto anchorDto,String userId);

    /**
     * 修改主播优惠码
     * @param anchorDto
     * @return
     */
    CommonResult<String> updateInvitationAnchorCode(AnchorDto anchorDto);

    /**
     * 校验填入的主播优惠码
     * @param invitationCode
     * @return
     */
    CommonResult<String> validateCode(String invitationCode);



    /**
     * 删除优惠码
     * @param invitationCodeId
     * @return
     */
    CommonResult<String> deleteCode(Long invitationCodeId);


    /**
     * 启用邀请码
     * @param invitationCodeId
     * @return
     */
    CommonResult<String> enableCode(Long invitationCodeId,Integer enableStatus);

    IPage<InvitationAnchorDetailResp> pageGameDiscountList(InvitationAnchorPageQuery invitationAnchorPageQuery);

    CommonResult<InvitationAnchorDetailResp> getInvitationAnchorDetail(Long invitationCodeId);

    CommonPage<InvitationAnchorListResp> pageInvitationAnchor(InvitationAnchorPageQuery request);
}
